package com.hyq.market.ui.home.mime;

import com.hyq.market.api.AbsServiceUtils;
import com.hyq.market.api.Constant;
import com.hyq.market.bean.UserInfo;
import com.hyq.market.utils.HttpConnetionUtil;

import org.xutils.http.RequestParams;

/**
 * Created by Administrator on 2017/7/27 0027.
 */

public class ModeUerInfo extends AbsServiceUtils {
    @Override
    public  UserInfo fromJson(String json) {
        UserInfo userInfo=gson.fromJson(json,UserInfo.class);
        return userInfo;
    }

    @Override
    public void getData() {
        super.getData();
       // BaseRequest request= (BaseRequest) ;
        RequestParams params=new RequestParams(Constant.API_User_index);
        params.addHeader("User-Agent","Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Mobile Safari/537.36");
        params.addHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
        params.addHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
        params.setUseCookie(true);
        params.addHeader("Cookie",Constant.LoginCookie);
        sendToServer(params);

//        Map<String, String> params2 = new HashMap<>();
////        params2.put("mobile",request.getUname());
////        params2.put("password",request.getId());
//        HttpConnetionUtil.post(Constant.API_User_index,params2,this);
    }
}
